<?php
$page_title = 'course.php';
require_once 'controller.php';

if($params->c != '') {
        $course = $instructor->getCourse($params->c);
        $groups = $course->getAllGroups();
} else {
        redirect('myetat.php');
}

require_once 'header.php';
?>
<div id="mainbody" >
<div class="bodycontent"><div class="txt1">
    <?php print anchor('/myetat.php','Home').' > '.$course->title ?>
    
    <div id='parser-update-data' class='invisible'>
            <?php
            $course = $instructor->getCourse($params->c);
            $all_groups = $course->getAllGroups();
            if($all_groups) {
                    $ids = array();
                    foreach($all_groups as $ag) {
                            $ids[] = $ag->id;
                    }
                    print json_encode($ids);
            }
            ?>
    </div>
   <div class="rightbar"> 
    	<div class="tabst2"><span class="txt2">Groups</span></div>
        <div class="right"><?php print "<a href='addgroup.php?c=$course->id'>Add Group</a>";?></div>
		<?php
        if(isset($groups)) {
                foreach($groups as $g) {
                        print "<div id='$g->id-details'>";
                        print "<a href='group.php?g=$g->id'>$g->name</a>";
                       // print counts($g);
                    // print "<li>SVN Commits: {$g->getSVNCount()}</li>
//                              <li>Wiki Updates: {$g->getWikiCount()}</li>
//                              <li>Forum Posts: {$g->getForumCount()}</li>
//                              <li>Files: {$g->getFileCount()}</li>
//                              <li>Issue Tracker Updates: {$g->getIssueCount()}</li>";
                        print '</div>';
                }
        } else {
        ?>
       <div id='update-msg'><p>Looks like you haven't added any groups for monitoring, yet.Let's get started by pressing the <b>Add Group</b> button below:</p>	
        </div>
    <?php
    }
   // print newBtn('add_group','Add Group',array('type'=>'button','onclick'=>'redirect("addgroup.php?c='.$course->id.'");'));
    ?>
    </div> <!--End of right bar-->
 	<div class="main" >
    	
            <div class = "right">
            <a href=""> Course Detail </a>| <a href="">Edit Course</a></div>
             <?php print"<div class='tabst2'><span class='txt2'> $course->title </span></div>"; ?>
               <h2>Annotations</h2>
                <p>Annotations are the observations of the teamwork activitites logged by the instructors.</p>
                <div><a href="">Create Annotations</a> | <a href="">View/Edit Annotations</a></div> <br />
                <h2>Survey</h2>
                Surveys are developed for the self assessment of teamwork. The result from the survey will be used for the future advancement and 	improvement
                <div><a href="">Survey</a></div> <br />
                <h2>Report</h2>
                Reports provide the detailed description as well as the summary of the various teamwork activities collected by the eTAT tool.
                <div><a href="reportgenerate.php"><a href="reportgenerate.php">Generate Report</a></div>
        </div>
        </div>
        </div><!--end of txt1-->
   </div><!--end of div of body Content-->
    <div class='clear'></div>
    <?php require_once 'footer.php'; ?>
